package com.jk.garden1.controller;

import com.jk.garden1.entity.SystemEntity;
import com.jk.garden1.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户管理
 */
@RestController
@RequestMapping("System")
public class SystemController {
    @Autowired
    private SystemService systemService;

    /**
     * 查询全部
     */
    @RequestMapping("selectSystemList")
    public List<SystemEntity> selectSystemList(){
        return systemService.selectSystemList();
    }
    /**
     * 添加
     */
    @RequestMapping("addSystem")
    public void addSystem(SystemEntity systemEntity){

        systemService.addSystem(systemEntity);
    }
    /**
     * 修改
     */
    @RequestMapping("updateSystem")
    public void updateSystem(SystemEntity systemEntity){

        systemService.updateSystem(systemEntity);
    }
    /**
     * 删除
     */
    @RequestMapping("delById")
    public void delById(Integer id){
        systemService.delById(id);
    }

    /**
     * es高亮查询
     * @param system
     * @return
     */
    @RequestMapping("queryEsList")
    public Object queryEsList(SystemEntity system){
        return systemService.queryEsList(system);
    }

}
